package com.lcb123.admin;


import com.lcb123.framework.domain.User;
import com.lcb123.framework.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * Created by yiban on 2017/4/1.
 */
@Controller
public class IndexController {

    private static final Logger LOGGER = LoggerFactory.getLogger(IndexController.class);
    private UserService userService;

    @Autowired
    public IndexController(UserService userService) {
        this.userService = userService;
    }
    @RequestMapping("/")
    public String index(ModelMap model) {
        if (this.userService!=null)
        {
            User user = this.userService.getUserByUsername("leo");
            LOGGER.debug("Getting user by username={}", user.toString());
        }

        return "index";

    }

}
